package org.hxzon.demo.scala

class Person(val name: String = "no name", money: Int = 100, var age: Int = 10) {

  override def toString(): String = "name=" + name + ",money=" + money + ",age=" + age
}

object Person {
  def main(args: Array[String]): Unit = {
    val xiaoming = new Person("xiaoming");
    println(xiaoming)
    println("name=" + xiaoming.name + ",age=" + xiaoming.age)
    xiaoming.age = 20
    //xiaoming.name="xiao xiao"//wrong
  }
}